home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / uplevel.n < prev    next >
Text File  |  1995-07-25  |  4KB  |  132 lines

  1.  
  2.  
  3.  
  4.      uuuupppplllleeeevvvveeeellll((((nnnn))))                   TTTTccccllll (((( ))))                   uuuupppplllleeeevvvveeeellll((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           uplevel - Execute a script in a different stack frame
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           uuuupppplllleeeevvvveeeellll ?_l_e_v_e_l? _a_r_g ?_a_r_g ...?
  15.      _________________________________________________________________
  16.  
  17.  
  18.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.           All of the _a_r_g arguments are concatenated  as  if  they  had
  20.           been  passed  to ccccoooonnnnccccaaaatttt; the result is then evaluated in the
  21.           variable context indicated by _l_e_v_e_l.   UUUUpppplllleeeevvvveeeellll  returns  the
  22.           result of that evaluation.
  23.  
  24.           If _l_e_v_e_l is an integer then it  gives  a  distance  (up  the
  25.           procedure  calling  stack)  to  move  before  executing  the
  26.           command.  If _l_e_v_e_l consists of #### followed by a  number  then
  27.           the  number  gives  an  absolute  level number.  If _l_e_v_e_l is
  28.           omitted then it defaults to 1111.  _L_e_v_e_l cannot be defaulted if
  29.           the first _c_o_m_m_a_n_d argument starts with a digit or ####.
  30.  
  31.           For example, suppose that procedure aaaa was invoked from  top-
  32.           level,  and  that it called bbbb, and that bbbb called cccc.  Suppose
  33.           that cccc invokes the uuuupppplllleeeevvvveeeellll command.  If _l_e_v_e_l is 1111 or ####2222  or
  34.           omitted,  then  the command will be executed in the variable
  35.           context of bbbb.  If _l_e_v_e_l is 2222 or ####1111 then the command will  be
  36.           executed  in the variable context of aaaa.  If _l_e_v_e_l is 3333 or ####0000
  37.           then the command will be executed at top-level (only  global
  38.           variables will be visible).
  39.  
  40.           The  uuuupppplllleeeevvvveeeellll  command  causes  the  invoking  procedure   to
  41.           disappear from the procedure calling stack while the command
  42.           is being executed.  In the above example, suppose cccc  invokes
  43.           the command
  44.  
  45.                uuuupppplllleeeevvvveeeellll 1111 {{{{sssseeeetttt xxxx 44443333;;;; dddd}}}}
  46.           where dddd is another Tcl  procedure.   The  sssseeeetttt  command  will
  47.           modify  the variable xxxx in bbbb's context, and dddd will execute at
  48.           level 3, as if called from bbbb.  If it in  turn  executes  the
  49.           command
  50.  
  51.                uuuupppplllleeeevvvveeeellll {{{{sssseeeetttt xxxx 44442222}}}}
  52.           then the sssseeeetttt command will modify the same variable xxxx in  bbbb's
  53.           context:   the procedure cccc does not appear to be on the call
  54.           stack when dddd is executing.  The command ``iiiinnnnffffoooo  lllleeeevvvveeeellll''  may
  55.           be used to obtain the level of the current procedure.
  56.  
  57.           UUUUpppplllleeeevvvveeeellll  makes  it  possible  to   implement   new   control
  58.           constructs  as Tcl procedures (for example, uuuupppplllleeeevvvveeeellll could be
  59.  
  60.  
  61.  
  62.      Page 1                                          (printed 7/17/95)
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.      uuuupppplllleeeevvvveeeellll((((nnnn))))                   TTTTccccllll (((( ))))                   uuuupppplllleeeevvvveeeellll((((nnnn))))
  70.  
  71.  
  72.  
  73.           used to implement the wwwwhhhhiiiilllleeee construct as a Tcl procedure).
  74.  
  75.  
  76.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  77.           context, stack frame, variables
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.      Page 2                                          (printed 7/17/95)
  129.  
  130.  
  131.  
  132.